<?php
/*
*Version 1.0
*-------------------------------------------
*COPY
*WEB:
*--------------------------------------------
*Author:li
*Date:2016-2-24
*/
require '../model/gamermangemodel.php';

class gamermanagecontrol{
	private $model;//业务模型
	private $view;
	private $view2;

	public function __construct(){
		
		$this->view="../view/main.php?url=gamermanager.php";
		$this->view2="../view/main.php?url=gamerxq.php";
		$this->model=new gamermangemodel();
	}


	public function load($view=null){
		if(empty($view))
		{
				
			header("location:{$this->view}");
		}
		else{
			header("location:{$view}");
		}

	}
	
	/*
	 *
	*
	*/
	public function doAction($action){


		if($action=='gamerquery'){
			
			$this->action_gamerquery();
		}
		else if($action=='gamerquery2'){
			$this->action_gamerquery2();
		}
		else if($action=='gamersuo'){
			$this->useradd();
		}
		else if($action=='gamerdel'){
			$this->userdel();
		}
		else{
			$this->load();
		}

	}

	//用户查询
	public function action_gamerquery(){
		
		//回自己界面
		$this->load($this->view."&gamerid=".$_POST['gamerid']);
		
	
	}
	public function action_gamerquery2(){
	
// 		$gamerid=$_POST['gamerid'];
// 		$rs=$this->model->gamerquery2($gamerid);
	
//  		session_start();
//  		if(empty($rs)){
//  			$_SESSION['info']="用户不存在";
// 		}
// 		else{
// 			$_SESSION['gamerlist']=$rs;
// 			var_dump($rs);
// 		}
	
		//回自己界面
		$this->load($this->view2."&gamerid=".$_POST['gamerid']);
	
	
	}
	
	//用户锁定
	public function action_gamersuo(){
		
	}
	
	//用户删除
	public function action_gamerdel(){
		
	}
}
?>